package com.sixth.controller;

import com.sixth.bean.MarketComment;
import com.sixth.bean.bo.WXOrderCommentBO;
import com.sixth.bean.common.BasePageInfo;
import com.sixth.bean.common.BaseRespVo;
import com.sixth.bean.vo.WXCommentCountVO;
import com.sixth.bean.vo.WXCommentListVO;
import com.sixth.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author qys
 * @Description
 * @date 2022/9/10 23:08
 */
@RestController
@RequestMapping("wx/comment")
public class WXCommentController {

    @Autowired
    CommentService commentService;

    @RequestMapping("list")
    public BaseRespVo wxCommentList(Integer valueId, Integer type, BasePageInfo basePageInfo, Integer showType) {
        Object wxCommentListVO = commentService.wxCommentList(valueId, type, basePageInfo, showType);
        return BaseRespVo.ok(wxCommentListVO);
    }

    @GetMapping("count")
    public BaseRespVo wxCommentCount(Integer valueId, Integer type) {
        WXCommentCountVO wxCommentCountVO = commentService.wxCommentCount(valueId, type);
        return BaseRespVo.ok(wxCommentCountVO);
    }

    @RequestMapping("post")
    public BaseRespVo wxCommentPost(@RequestBody MarketComment marketComment) {
        int code = commentService.wxOrderPost(marketComment);
        return BaseRespVo.ok();
    }
}
